<?php


namespace App\Transformers\User;


use League\Fractal\TransformerAbstract;

class UserVisitTransFormer extends TransformerAbstract
{
    public function transform($data)
    {
    return [
         'id'=>$data->id ,
         'user_id' =>$data->user_id ?? '',
         'url' =>$data->url ?? '',
         'ip' =>$data->ip ?? '',
         'stay_time' =>$data->stay_time ?? '',
         'channel_type' =>$data->channel_type ?? '',
         'province' =>$data->province ?? '',
         'content' =>$data->content ?? '',
        'created_at' => $data->created_at ? $data->created_at->format("Y-m-d H:i:s") : '',
        'updated_at' => $data->updated_at ? $data->updated_at->format("Y-m-d H:i:s") : '',
    ];

    }

}
